package com.subnext.model;

import static com.subnext.utils.EntityUtil.getStringProperty;
import static com.subnext.utils.EntityUtil.setProperty;

import java.util.Date;

import com.google.appengine.api.datastore.Entity;
public class TagEntity extends BaseEntity {

	private static final long serialVersionUID = 1L;

	private String tag;

	private String description;

	/**
	 * @param tag
	 * @param type
	 * @param createDate
	 * @param description
	 * @param status
	 */
	public TagEntity(String tag, Date createDate, String description,
			int status) {
		super();
		this.tag = tag;
		this.description = description;
	}

	@Override
	public void save(Entity entity) {
		super.save(entity);
		setProperty(entity, "tag", tag, false);
		setProperty(entity, "description", description, false);
	}

	@Override
	public void load(Entity entity) {
		super.load(entity);
		tag = getStringProperty(entity, "tag");
		description = getStringProperty(entity, "description");
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}


	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

	public TagEntity() {
		super();
	}

	@Override
	public String toString() {
		return "TagEntity [tag=" + tag + ", description=" + description+ "]";
	}

}
